[XEND] Fix configureBootloader to work with HTTP/SEXP.
authorAlastair Tse <atse@xensource.com>
Thu, 7 Dec 2006 11:41:38 +0000 (11:41 +0000)
committerAlastair Tse <atse@xensource.com>
Thu, 7 Dec 2006 11:41:38 +0000 (11:41 +0000)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/XendDomainInfo.py

index 7f0da376538a3cedcbab35088d1058cbaff8d784..1f5571b8badc7d0b89098220ba1302476a8daada 100644 (file)
@@ -680,6 +680,7 @@ class XendConfig(dict):
                 else:
                     self[sxp_arg] = val
 
+        _set_cfg_if_exists('bootloader')
         _set_cfg_if_exists('shadow_memory')
         _set_cfg_if_exists('security')
         _set_cfg_if_exists('features')
index 5488b17f8f2a532f9e36eefbb9ef97d398f7b3f5..5fda486555ff828ad0ea6adb4c967c20e7e31704 100644 (file)
@@ -1326,7 +1326,7 @@ class XendDomainInfo:
 
         # if we have a boot loader but no image, then we need to set things
         # up by running the boot loader non-interactively
-        if self.info.get('bootloader') and self.info.get('image'):
+        if self.info.get('bootloader'):
             self._configureBootloader()
 
         if not self._infoIsSet('image'):
@@ -1532,11 +1532,17 @@ class XendDomainInfo:
         if not self.info.get('bootloader'):
             return
         blcfg = None
+
         # FIXME: this assumes that we want to use the first disk device
-        for devuuid, (devtype, devinfo) in self.info.all_devices_sxpr():
+        for (devtype, devinfo) in self.info.all_devices_sxpr():
             if not devtype or not devinfo or devtype not in ('vbd', 'tap'):
                 continue
-            disk = devinfo.get('uname')
+            disk = None
+            for param in devinfo:
+                if param[0] == 'uname':
+                    disk = param[1]
+                    break
+
             if disk is None:
                 continue
             fn = blkdev_uname_to_file(disk)